package routers

import (
	"boomlive.com/boomlive-openapi-game/filters"
	beego "github.com/beego/beego/v2/server/web"
)

// 注册所有beego过滤器
func init() {
	beego.InsertFilter("*", beego.BeforeRouter, filters.Cors())
	beego.InsertFilter("*", beego.BeforeExec, filters.FilterRequestLog)
	beego.InsertFilter("/client/*", beego.BeforeExec, filters.FilterSign)
	beego.InsertFilter("/client/*", beego.BeforeExec, filters.FilterToken)
	beego.InsertFilter("/file/*", beego.BeforeExec, filters.FilterToken)
	beego.InsertFilter("/server/*", beego.BeforeExec, filters.FilterIp)
	beego.InsertFilter("/server/*", beego.BeforeExec, filters.FilterCode)
	beego.InsertFilter("/service/*", beego.BeforeExec, filters.FilterServiceCode)
}
